// JavaScript Document by Richbox
function initTree(t) {
	var tree=document.getElementById(t);
	tree.style.display="none";
	var lis=tree.getElementsByTagName("li");
	//alert(lis.length);
	for(var i=0;i<lis.length;i++) {
		lis[i].id="li"+i;
		var uls=lis[i].getElementsByTagName("dl");
		if(uls.length!=0) {
			uls[0].id="dl"+i;
			uls[0].style.display="none";
			var as=lis[i].getElementsByTagName("a");
			as[0].id="a"+i;
			as[0].className="folder";
			as[0].href="#this";
			as[0].tget=uls[0];
			as[0].onclick=function() {
				openTag(this,this.tget);
			}
		}
	}
	tree.style.display="block";
}
function openTag(a,t) {
	if(t.style.display=="block") {
		t.style.display="none";
		a.className="folder";
	} else {
		t.style.display="block";
		a.className="";
	}
}
window.onload=function() {
	initTree("globalNav");
}


//全选信息
function checkAll(e, itemName){
  var aa = document.getElementsByName(itemName);
  for (var i=0; i<aa.length; i++)
   aa[i].checked = e.checked;
}

function checkItem(e, allName){
  var all = document.getElementsByName(allName)[0];
  if(!e.checked) all.checked = false;
  else{
    var aa = document.getElementsByName(e.name);
    for (var i=0; i<aa.length; i++)
     if(!aa[i].checked) return;
    all.checked = true;
  }
}